layui.use(['form','layer','laydate','table','laytpl','element'],function(){
    var element = layui.element;
    var laydate = layui.laydate;
    var form = layui.form,
        layer=layui.layer;
    $ = layui.jquery,
        laytpl = layui.laytpl,
        table = layui.table;


    //监听Tab切换，以改变地址hash值
    element.on('tab(layui-tab)', function(){
        var layId = this.getAttribute('lay-id');
        var url = "";
        switch (layId){
            case "mFlowSetting":
                url = "/flowConfig/flowSetting?flowType=main&packageId="+packageId;
                break;
            case "queryKnowledgeBase":
                url = "/knowledgeBase/queryKnowledgeBase?packageId="+packageId+"&affectType=p";
                break;
            case "multiFlowSetting":
                url = "/flowConfig/flowSetting?flowType=multiWheel&packageId="+packageId;
                break;
            case "queryLearningAnalysis":
                url = "/learningAnalysis/queryLearningAnalysis?packageId="+packageId;
                break;
            case "queryRecordsByPackageId":
                url = "/records/queryRecordsByPackageId?packageId="+packageId;
                break;
            case "queryCommonKnowledgeBase":
                url = "/knowledgeBase/queryCommonKnowledgeBase?packageId="+packageId;
                break;
            default:
                break;
        }

        var iframes = $(".layui-show iframe");
        if(url!="" && iframes!=null && iframes!=undefined && iframes.length>0){
            if(iframes[0].src!=""){
                console.log("tab页面已加载过了");
                return;
            }else{
                iframes[0].src = baseUrl + url;
            }
        }else{
            console.log("暂不做处理");
            return;
        }
    });

});